package br.com.gaacorp.sai.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "tab_alternative")
public class Alternative extends BaseObject implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1486067057296856552L;
	private Long alternativeId;
	private String name;
	private String description;
	private String symbol;
	private int value;

	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Alternative)) {
			return false;
		}

		final Alternative alternative = (Alternative) o;

		return !(name != null ? !name.equals(alternative.name)
				: alternative.name != null);
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getAlternativeId() {
		return alternativeId;
	}

	public String getDescription() {
		return description;
	}

	public String getName() {
		return name;
	}



	public String getSymbol() {
		return symbol;
	}

	public int getValue() {
		return value;
	}

	public int hashCode() {
		return (name != null ? name.hashCode() : 0);
	}

	public void setAlternativeId(Long alternativeId) {
		this.alternativeId = alternativeId;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setName(String name) {
		this.name = name;
	}


	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append(
				this.name).toString();
	}

}
